define(function(require, exports, module) {
    require("define");
    require('jqueryConfirm');

    $(function(){
        //异步提交表单
        $("#userModifyajaxSubmit").on("click",function(){
            var params = $("#userModifysubmitForm").serializeObject(); //将表单序列化为JSON对象
            var request = JSON.stringify(params)
            $.ajax({
                type : 'POST',
                url : '/manage/user/modify',
                dataType : 'json',
                contentType : 'application/json',
                data : JSON.stringify(params),
                beforeSend : function () {
                },
                success : function (data) { // 返回的RequestResult的json对象
                    $.MsgBox.Confirm("提示", data.message);
                },
            });
        });
    });

    $.fn.serializeObject = function() {
        var o = {};
        var a = this.serializeArray();
        $.each(a, function() {
            if (o[this.name]) {
                if (!o[this.name].push) {
                    o[this.name] = [ o[this.name] ];
                }
                o[this.name].push(this.value || '');
            } else {
                o[this.name] = this.value || '';
            }
        });
        return o;
    }

});